Skip to content

feat: v0.8.0 — classifier QA fix, routing trace, cold-start UX (#39-#46)#49

Merged
SmartBrandStrategies merged 5 commits intomainfrom
feat/classifier-observability
Mar 6, 2026
Merged

feat: v0.8.0 — classifier QA fix, routing trace, cold-start UX (#39-#46)#49
SmartBrandStrategies merged 5 commits intomainfrom
feat/classifier-observability

Conversation

@SmartBrandStrategies
Copy link
Copy Markdown
Contributor

Summary

This PR lands all remaining issues for v0.8.0 across three clusters:

Classifier cluster (#44 #45 #46)

  • QA phrase override: smoke test, contract test, schema compat, approval gate, verified against, test fixtures now fire a phrase-level pre-routing override before keyword scoring — prevents infra/backend keyword count from outvoting compound QA signals
  • Routing trace: ClassificationResult gains optional routingTrace?: RoutingTrace with headingModule, phraseOverride, and per-module candidateScores for debugging
  • adf tidy --verbose: prints per-item routing rationale (module, section, trigger scores or phrase override phrase)
  • 9 new tests covering phrase override, triggerMap guard, and routingTrace shape

Cold-start cluster (#39 #40 #41)

  • adf migrate --keep-summary: injects auto-generated ## Architecture Summary into the thin-pointer CLAUDE.md listing which modules content went to (constraints/context/advisory counts) — agents get architectural orientation without rule duplication
  • adf migrate --audit: prints per-module breakdown post-migration and flags potential misroutes (items routed to core.adf that scored non-zero for a specialized module via routingTrace)
  • doctor sparse-pointer [info] warn: new INFO status tier (soft, does not fail --ci); fires when a thin-pointer CLAUDE.md has <15 lines and no stack/framework keywords, suggests charter adf populate

Also includes (from feat/adf-populate)

  • charter adf populate auto-fills ADF files from codebase signals (package.json, README, stack detection)
  • Unknown patch op now throws descriptive error listing valid ops (shell: true in git operations creates command injection vector #43 UX)
  • CORE_SCAFFOLD includes CONTEXT placeholder
  • Security: directory traversal fix in adf create, shell: true removed from runGit()

Test plan

  • pnpm test — 273+ passing (1 pre-commit hook test is a WSL timing flake when run in full suite, passes in isolation)
  • charter adf migrate --dry-run --keep-summary on a real CLAUDE.md
  • charter adf migrate --audit shows per-module breakdown
  • charter doctor shows [info] on sparse thin pointers
  • charter adf tidy --verbose shows routing trace per item

Closes #39, #40, #41, #44, #45, #46

🤖 Generated with Claude Code

kovermier and others added 5 commits March 5, 2026 17:02
…versal

Closes #43: Remove shell: true from runGit() in git-helpers.ts. Node.js
resolves the git binary via PATH directly without a shell on WSL, Linux,
macOS, and Windows. shell: true is unnecessary and allows shell metacharacters
in args to be interpreted as shell syntax.

Closes #42: Validate module paths in adf create before path.join. Paths
containing ".." or absolute paths are rejected with a clear error. A secondary
resolved-path check confirms the final path stays within the .ai/ directory,
guarding against platform-specific bypass patterns.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ld section

charter adf populate [--dry-run] [--force] [--ai-dir <dir>]
  Reads package.json, README.md, and stack detection signals to auto-fill
  ADF files with project-specific content after charter adf init. Populates
  CONTEXT in core/backend/frontend.adf and STATE in state.adf. Idempotent:
  skips files with non-scaffold content unless --force.

patcher: unknown ops now produce a clear error listing valid op names
  instead of the cryptic "handlers[op.op] is not a function" TypeError.

CORE_SCAFFOLD: add a CONTEXT section placeholder so ADD_BULLET
  section:CONTEXT works immediately after adf init without requiring
  ADD_SECTION first.

adf patch help: list all valid ops with concrete usage examples.

bootstrap/init next steps: point to charter adf populate as step 1
  instead of generic "edit core.adf manually" guidance.

harness: extend SDLC corpus and runner with mixed QA/backend signal
  scenarios that exposed the classifier routing issues filed in #44/#45.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
 #45 #46)

- QA compound phrases (smoke test, contract test, schema compat, approval
  gate, verified against, test fixtures) now fire a phrase-level override
  BEFORE keyword scoring so they cannot be outvoted by raw infra/backend
  keyword count (#44, #45)
- contentToModule() returns { module, phraseOverride?, scores } so all
  per-module candidate scores are visible to callers (#46)
- ClassificationResult gains optional routingTrace?: RoutingTrace with
  headingModule, phraseOverride, and candidateScores for debugging
- adf tidy --verbose prints per-item routing rationale (module, section,
  trigger scores or phrase override) (#46)
- 9 new tests covering phrase override routing, guard against absent
  qa.adf in triggerMap, and routingTrace shape (#44 #45 #46)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rse-pointer warn (#39 #40 #41)

- adf migrate --keep-summary: injects auto-generated "## Architecture
  Summary" block listing migrated module names and section counts so
  CLAUDE.md thin pointer gives agents architectural orientation without
  duplicating rules (#39)
- adf migrate --audit: prints per-module breakdown (constraints/context/
  advisory counts) and flags potential misroutes via routingTrace — items
  routed to core.adf that scored non-zero for a specialized module (#40)
- doctor: adds 'INFO' status tier (soft, does not fail overall check);
  warns [info] when thin-pointer CLAUDE.md has <15 lines and no
  stack/framework keywords — agents have zero orientation, suggests
  charter adf populate (#41)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@SmartBrandStrategies SmartBrandStrategies merged commit f03fe27 into main Mar 6, 2026
1 of 4 checks passed
@SmartBrandStrategies SmartBrandStrategies deleted the feat/classifier-observability branch March 6, 2026 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

adf migrate: thin pointer leaves zero architectural context

2 participants